<?php

/**
 * Giftbox filter form.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormFilterTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class GiftboxFormFilter extends BaseGiftboxFormFilter
{

    public function getChoisePub()
  {
      if(sfContext::getInstance()->getUser()->issuperAdmin())
      return array('1' => 'новый', '2' => 'на утверждении', '3' => 'утвержден');

      if(sfContext::getInstance()->getUser()->hasCredential('partner'))
      return array('1' => 'новый', '2' => 'на утверждении' );
  }

  public function configure()
  {

      $this->widgetSchema['pub'] = new sfWidgetFormChoice ( array ('choices' => $this->getChoisePub() ));
      $this->widgetSchema['from_id'] = new sfWidgetFormInput( array(),array ('style' => 'width: 50px'));
      $this->widgetSchema['to_id'] = new sfWidgetFormInput( array(),array ('style' => 'width: 50px'));

  }
}
